if (CMAKE_HOST_WIN32)

	SET(OPENSSL_DIR ${THIRD_PARTY}/windows/x86/openssl)
	if(CMAKE_SIZEOF_VOID_P EQUAL 8)
		SET(OPENSSL_DIR ${THIRD_PARTY}/windows/x64/openssl)
	endif()

	SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
	SET(OPENSSL_LIB_DIR  ${OPENSSL_DIR}/lib)
	SET(OPENSSL_LIBS libcrypto libssl)
ELSE()

	IF(CMAKE_TOOLCHAIN_FILE)
		IF (CMAKE_SYSTEM_NAME STREQUAL Android)

			IF (ANDROID_ABI STREQUAL armeabi-v7a)
				SET(OPENSSL_DIR ${THIRD_PARTY}/android/openssl/armeabi-v7a)
			ELSEIF (ANDROID_ABI STREQUAL arm64-v8a)
				SET(OPENSSL_DIR ${THIRD_PARTY}/android/openssl/arm64-v8a)
			ENDIF()

			SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
			SET(OPENSSL_LIB_DIR ${OPENSSL_DIR}/lib)

		ELSEIF (CMAKE_C_COMPILER MATCHES "hisiv300")
			SET(OPENSSL_DIR ${THIRD_PARTY}/hisiv300/openssl)
			SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
			SET(OPENSSL_LIB_DIR ${OPENSSL_DIR}/lib)
		ENDIF()

		IF (CMAKE_C_COMPILER MATCHES "hisiv400")
			SET(OPENSSL_DIR ${THIRD_PARTY}/hisiv400/openssl)
			SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
			SET(OPENSSL_LIB_DIR ${OPENSSL_DIR}/lib)
		ENDIF()

		IF (CMAKE_C_COMPILER MATCHES "hisiv500")
			SET(OPENSSL_DIR ${THIRD_PARTY}/hisiv500/openssl)
			SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
			SET(OPENSSL_LIB_DIR ${OPENSSL_DIR}/lib)
		ENDIF()

		IF (CMAKE_C_COMPILER MATCHES "hisiv600")
			SET(OPENSSL_DIR ${THIRD_PARTY}/hisiv600/openssl)
			SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
			SET(OPENSSL_LIB_DIR ${OPENSSL_DIR}/lib)
		ENDIF()

		IF (CMAKE_C_COMPILER MATCHES "himix100")
			SET(OPENSSL_DIR ${THIRD_PARTY}/himix100/openssl)
			SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
			SET(OPENSSL_LIB_DIR ${OPENSSL_DIR}/lib)
		ENDIF()

		IF (CMAKE_C_COMPILER MATCHES "himix200")
			SET(OPENSSL_DIR ${THIRD_PARTY}/himix200/openssl)
			SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
			SET(OPENSSL_LIB_DIR ${OPENSSL_DIR}/lib)
		ENDIF()

		IF (CMAKE_C_COMPILER MATCHES "gcc")
			SET(OPENSSL_DIR ${THIRD_PARTY}/gcc/openssl)
			SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
			SET(OPENSSL_LIB_DIR ${OPENSSL_DIR}/lib)
		ENDIF()

		SET(OPENSSL_LIBS ${OPENSSL_LIB_DIR}/libssl.a ${OPENSSL_LIB_DIR}/libcrypto.a)
	ELSE()
		SET(OPENSSL_DIR ${THIRD_PARTY}/gcc/openssl)
		SET(OPENSSL_INCLUDE_DIR ${OPENSSL_DIR}/include)
		SET(OPENSSL_LIB_DIR ${OPENSSL_DIR}/lib)
		SET(OPENSSL_LIBS ${OPENSSL_LIB_DIR}/libssl.a ${OPENSSL_LIB_DIR}/libcrypto.a)
	ENDIF()	
ENDIF()
